import Vue from 'vue'
import Vuex from 'vuex'
import A from 'vuex-persistedstate'
Vue.use(A)
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
      cartList:{
        num:"",
        size:'',
        basicInfo:''
      },
      list:[]
  },
  mutations: {
     // 获取添加的商品详情
     changeBasicInfo(state,val){
      state.cartList.basicInfo = val
    },
    //获取数量
    changeNum(state,val){
      state.cartList.num = val
    },
    // 获取尺码
    changeSize(state,val){
      state.cartList.size = val
    },
    // 加入购物车
    addList(state,val){
     state.list.push(val)
    },
   

  },
  actions: {
  },
  modules: {
  },
  plugins:[ A() ]
})
